package com.xch.sboot.persistence.repository.account;

import com.xch.sboot.persistence.domain.account.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

/**
 * @author xch
 * 2022/7/20 21:17
 */
public interface UserRepository extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {
    User findFirstByUsernameOrEmailAndDelFlagIsFalse(String username, String email);

    boolean existsByUsernameAndDelFlagIsFalse(String username);

    boolean existsByEmailAndDelFlagIsFalse(String email);

    boolean existsByNicknameAndDelFlagIsFalse(String nickname);
}
